<?php

use Illuminate\Database\Seeder;

class LogisticsCompanySeeder extends Seeder
{
    protected $companies = [
        [
            'name' => '顺丰速运',
            'bukrs' => 'shunfeng',
            'hotline' => '955338',
        ],
        [
            'name' => '申通快递',
            'bukrs' => 'shentong',
            'hotline' => '95543',
        ],
        [
            'name' => '圆通快递',
            'bukrs' => 'yuantong',
            'hotline' => '95554',
        ],
        [
            'name' => '中通快递',
            'bukrs' => 'zhongtong',
            'hotline' => '95311',
        ],
        [
            'name' => '百世快递',
            'bukrs' => 'huitongkuaidi',
            'hotline' => '400-956-5656',
        ],
        [
            'name' => '韵达快递',
            'bukrs' => 'yunda',
            'hotline' => '95546',
        ],
        [
            'name' => '天天快递快递',
            'bukrs' => 'yitongfeihong',
            'hotline' => '4001-888-888',
        ],
        [
            'name' => 'EMS',
            'bukrs' => 'ems',
            'hotline' => '11183',
        ],
        [
            'name' => '邮政包裹/挂号信',
            'bukrs' => 'youzhengguonei',
            'hotline' => '11183',
        ],
        [
            'name' => '德邦物流',
            'bukrs' => 'debangwuliu',
            'hotline' => '95353',
        ],
        [
            'name' => '宅急送',
            'bukrs' => 'zhaijisong',
            'hotline' => '400-6789-000',
        ],
        [
            'name' => '全峰快递',
            'bukrs' => 'quanfengkuaidi',
            'hotline' => '400-100-0001',
        ],
    ];

    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        foreach ($this->companies as $company) {
            \App\Entities\LogisticsCompany::query()->updateOrCreate(['bukrs' => $company['bukrs']], $company);
            echo 'create or update: ', $company['name'], '(', $company['bukrs'], ') successful.', PHP_EOL;
        }
    }
}
